<?php
class User_Model_Info extends Zend_Db_Table_Abstract
{
	public function getedit($id)
	{
		$db = Zend_Registry::get('connectDB');
		$data = $db->fetchRow($db->select()->from('users')->where('id_user =?',$id));
		return $data;
	}
	public function edit($id,$fullname,$address,$email,$phone)
	{
		$db = Zend_Registry::get('connectDB');
		$data = array('fullname'=>$fullname,'address'=>$address,'email'=>$email,'phone'=>$phone);
		$where = $db->quoteInto('id_user = ?',$id);
		$update = $db->update('users',$data,$where);
		return $update;
	}
	public function getpass($id)
	{
		$db = Zend_Registry::get('connectDB');
		$data = $db->fetchRow($db->select()->from('users','password')->where('id_user =?',$id));
		return $data;
	}
	public function changpass($id,$passnew)
	{
		$db = Zend_Registry::get('connectDB');
		$data = array('password'=>$passnew);
		$where = $db->quoteInto('id_user = ?',$id);
		$update = $db->update('users',$data,$where);
		return $update;
	}
}